<template>
  <!-- <div  v-if="show">
    <text class="message" @click="todo">Now, let's use Vue.js to build your Weex app.</text>
  </div>
  <div  v-else>
    <text class="message" @click="todo">Now</text>
  </div> -->
  <div class="home-container">
    <web ref=webview :src="homeUrl" class="webHome" @pagestart="start" @pagefinish="finish" @error="error"></web>
  </div>
</template>


<script>

  const utils = require('../lib/utils');
  const navigator = weex.requireModule('navigator');
  var modal = weex.requireModule('modal')
  const webview = weex.requireModule('webview')
// http://eip7s3test.hkbf.com.cn/#/Home
  export default {
    data () {
      return {
        homeUrl:'http://eip7stest2.hkbf.com.cn/home/schedule?&uid=BF1010755',
        show:false
      }
    },

     methods: {
       // tood () {
       //   const url = weex.config.bundleUrl
       //   var newUrl = utils.setBundleUrl(url, 'MyCenter/mySet.js')
       //   navigator.push({
       //      url: newUrl+'',
       //      animated: "true"
       //  }, event => {
       //      modal.toast({ message: 'callback: ' + newUrl,duraction:1000})
       //  })
       // },

       reload (event) {
       console.log('will reload webview')
       modal.toast({ message: 'reload' })
       webview.reload(this.$refs.webview)
       },
       start (event) {
         console.log('pagestart', event)
         modal.toast({ message: 'pagestart' })
       },
       finish (event) {
         console.log('pagefinish', event)
         modal.toast({ message: 'pagefinish' })
       },
       error (event) {
         console.log('error', event)
         modal.toast({ message: 'error' })
       }

     }
  }

</script>

<style scoped>
  .webHome {
  width:750px;
  height: 1200px;
  margin-top: 10px;
  }

</style>
